package cn.shangqizhenshuai.extend;

import cn.shangqizhenshuai.convert.DbColumnType;
import cn.shangqizhenshuai.core.ExecuteCore;
import cn.shangqizhenshuai.entity.MapperEntity;
import cn.shangqizhenshuai.entity.XmlEntity;
import cn.shangqizhenshuai.extend.entity.*;
import cn.shangqizhenshuai.util.ExtendsXml;
import cn.shangqizhenshuai.util.Util;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.apache.commons.beanutils.BeanUtils;
import org.htmlcleaner.XPatherException;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.util.*;

/**
 *
 */
public class ExtendCore extends ExecuteCore {
    public String SqlXmlPath = null;
    public String extendsmapperftlpath = null;
    public String extendsserviceftlpath = null;
    public String extendsserviceimplftlpath = null;
    public String extendsentitypath = null;
    public String extendsmapperxmlftlpath = null;
    List<XmlEntity> xmlEntities = null;
    SqlXmlEntity sqlXmlEntity = null;
    //基本类型映射
    DbColumnType[] values=null;
    //全局需要导入的包
    HashSet<String> strings = null;
    //所有创建的对象
    List<ResultrefEntity> create_entity_name=null;
    //获取实体类的包的地址
    String packagename3 = null;
    //获取的信息
    List<MapperEntity> mapentity;
    //service导入层的包
    List<String> servicepackage;
    /**
     * @param context 上下文变量
     * @return
     * @throws IOException
     * @throws TemplateException
     */
    public HashMap<String, List> execute(HashMap<String, List> context) throws IOException, TemplateException {
        //创建xml
        try {
            this.createxml(context);
        } catch (XPatherException e) {
            e.printStackTrace();
        }
        return context;

    }

    /**
     * 具体实现方法
     *
     * @param context 上下文变量
     * @throws IOException
     * @throws TemplateException
     * @throws XPatherException
     */
    public void createxml(HashMap<String, List> context) throws IOException, TemplateException, XPatherException{
        if (SqlXmlPath != null) {
            sqlXmlEntity = ExtendsXml.getsql(SqlXmlPath);
        }

        xmlEntities = context.get("mapperxmlinfo");
        servicepackage = context.get("servicepackage");


        HashMap<String, Object> map = new HashMap<String, Object>();
        //开始创建实体类
        //配置模板文件对象
        Configuration conf3 = new Configuration();
        //导入模板目录
        File file3 = new File("src/main/resources/");
        conf3.setDirectoryForTemplateLoading(file3);
        Template temp3 = conf3.getTemplate(this.getExtendsentitypath());
        //开始文件输出
        packagename3 = xmlEntities.get(0).getEntitypackagename();
        String[] split3 = packagename3.split("\\.");
        String outpath3 = "src/main/java/" + this.getOutFilePath();
        for (String s : split3) {
            outpath3 += "/" + s;
        }
        //获取所有枚举类型
        values  = DbColumnType.values();
        //获取全部信息进行解析创建
        create_entity_name = sqlXmlEntity.getCreate_entity_name();
        for (ResultrefEntity resultrefEntity : this.create_entity_name) {
            ExtendsEntity extendsEntity = new ExtendsEntity();
            extendsEntity.setJavaname(Util.upperCase(resultrefEntity.getJavaname()));
            extendsEntity.setImPackage(packagename3);
            List<Property> property = resultrefEntity.getProperty();
            HashMap<String, String> stringStringHashMap = new HashMap<String, String>();
            HashSet<String> strings = new HashSet<String>();
            for (Property p : property) {
                stringStringHashMap.put(p.getFlag(), p.getType());
                for (DbColumnType value : values) {
                    if (value.getPkg() != null && value.getType().equalsIgnoreCase(p.getType())) {
                        strings.add(value.getPkg());
                        break;
                    }
                }
            }
            extendsEntity.setProperty(stringStringHashMap);
            extendsEntity.setImpotrs(strings);
            //创建文件夹
            File file13 = new File(outpath3);
            file13.mkdirs();
            Writer out3 = new FileWriter(new File(outpath3 + "/" + extendsEntity.getJavaname() + ".java"), false);
            temp3.process(extendsEntity, out3);
            out3.flush();
            out3.close();
        }


        List<ExtendSelectEntity> selectsql =  sqlXmlEntity.getSelectsql();
        List<ExtendsUpdataeEntity> updatesql =  sqlXmlEntity.getUpdatesql();
        List<ExtndsDeleteEntity> deletesql =  sqlXmlEntity.getDeletesql();
        List<ExtendsInsertEntity> insertsql =  sqlXmlEntity.getInsertsql();
//        ArrayList<ExtendSelectEntity> selectsql1 = (ArrayList<ExtendSelectEntity>) selectsql.clone();
//        ArrayList<ExtendsUpdataeEntity> updatesql1 = (ArrayList<ExtendsUpdataeEntity>) updatesql.clone();
//        ArrayList<ExtndsDeleteEntity> deletesql1 = (ArrayList<ExtndsDeleteEntity>) deletesql.clone();
//        ArrayList<ExtendsInsertEntity> insertsql1 = (ArrayList<ExtendsInsertEntity>) insertsql.clone();
//        ArrayList<ExtendSelectEntity> selectsql2 =   (ArrayList<ExtendSelectEntity>) selectsql.clone();
//        ArrayList<ExtendsUpdataeEntity> updatesql2 = (ArrayList<ExtendsUpdataeEntity>) updatesql.clone();
//        ArrayList<ExtndsDeleteEntity> deletesql2 =   (ArrayList<ExtndsDeleteEntity>) deletesql.clone();
//        ArrayList<ExtendsInsertEntity> insertsql2 =  (ArrayList<ExtendsInsertEntity>) insertsql.clone();
//        System.out.println(selectsql1==selectsql);
//        System.out.println(selectsql2==selectsql1);



        //需要生成的信息
        map.put("mapperxmlinfo", xmlEntities);
        map.put("updatesql", updatesql);
        map.put("insertsql", insertsql);
        map.put("deletesql", deletesql);
        map.put("selectsql", selectsql);

        //开始生成 mapper.java
        Configuration conf4 = new Configuration();
        //导入模板目录
        File file4 = new File("src/main/resources/");
        conf4.setDirectoryForTemplateLoading(file4);
        Template temp4 = conf4.getTemplate(this.getExtendsmapperftlpath());
        //开始文件输出
        String packagename4 = xmlEntities.get(0).getMapperpackagename();
        String[] split4 = packagename4.split("\\.");
        String outpath4 = "src/main/java/" + this.getOutFilePath();
        for (String s : split4) {
            outpath4 += "/" + s;
        }
        strings = new HashSet<String>();
        //生成service的对象
        ArrayList<ExtendsMapperEntity> serviceselectmethod = this.getmappermethod(selectsql, true, false);
        ArrayList<ExtendsMapperEntity> serviceupdatemethod = this.getmappermethod(updatesql, false, false);
        ArrayList<ExtendsMapperEntity> servicedeletemethod = this.getmappermethod(deletesql, false, false);
        ArrayList<ExtendsMapperEntity> serviceinsertmethod = this.getmappermethod(insertsql, false, false);
        //方法的值
        map.put("selectmethod", this.getmappermethod(selectsql, true,true));
        map.put("updatemethod", this.getmappermethod(updatesql, false,true));
        map.put("deletemethod", this.getmappermethod(deletesql, false,true));
        map.put("insertmethod", this.getmappermethod(insertsql, false,true));

        //给xml文件提供mapper地址
        map.put("mapperp", packagename4+".ExtendsMapper");
        //需要导入的包
        map.put("imports", strings);
        map.put("imPackage", packagename4);
        //提供返回值类型是否为list


        //创建mapper文件
        //创建文件夹
        File file14 = new File(outpath4);
        file14.mkdirs();
        Writer out4 = new FileWriter(new File(outpath4 + "/ExtendsMapper.java"), false);
        temp4.process(map, out4);
        out4.flush();
        out4.close();

        //开始生成mapperxml

        //配置模板文件对象
        Configuration conf = new Configuration();
        //导入模板目录
        File file = new File("src/main/resources/");
        conf.setDirectoryForTemplateLoading(file);
        Template temp = conf.getTemplate(this.getExtendsmapperxmlftlpath());
        //开始文件输出
        String packagename = xmlEntities.get(0).getMapperpackagename();
        String[] split = packagename.split("\\.");
        String outpath = "src/main/java/" + this.getOutFilePath();
        for (String s : split) {
            outpath += "/" + s;
        }
        ArrayList<ExtenedsMapperXmlEntity> selectxml = new ArrayList<ExtenedsMapperXmlEntity>();
        ArrayList<ExtenedsMapperXmlEntity> updatexml = new ArrayList<ExtenedsMapperXmlEntity>();
        ArrayList<ExtenedsMapperXmlEntity> deletexml = new ArrayList<ExtenedsMapperXmlEntity>();
        ArrayList<ExtenedsMapperXmlEntity> insertxml = new ArrayList<ExtenedsMapperXmlEntity>();

        //创建xml文件需要的信息
        //sql语句
        for (ExtendsMapperEntity extendsMapperEntity : serviceselectmethod) {
            ExtenedsMapperXmlEntity extenedsMapperXmlEntity = new ExtenedsMapperXmlEntity();
            for (ExtendSelectEntity extendSelectEntity : selectsql) {
                if(extendSelectEntity.getName().equalsIgnoreCase(extendsMapperEntity.getMethodname())){
                    //是同一个对象
                    extenedsMapperXmlEntity.setReturnType(packagename3+"."+extendsMapperEntity.getReturnType());
                    extenedsMapperXmlEntity.setXmlselectname(extendsMapperEntity.getMethodname());
                    extenedsMapperXmlEntity.setXmlselectsql(extendSelectEntity.getSql());
                    break;
                }
            }
            selectxml.add(extenedsMapperXmlEntity);
        }
        for (ExtendsMapperEntity extendsMapperEntity : serviceupdatemethod) {
            ExtenedsMapperXmlEntity extenedsMapperXmlEntity = new ExtenedsMapperXmlEntity();
            for (ExtendsUpdataeEntity extendsUpdataeEntity : updatesql) {
                if(extendsUpdataeEntity.getName().equalsIgnoreCase(extendsMapperEntity.getMethodname())){
                    //是同一个对象
                    extenedsMapperXmlEntity.setReturnType(packagename3+"."+extendsMapperEntity.getReturnType());
                    extenedsMapperXmlEntity.setXmlselectname(extendsMapperEntity.getMethodname());
                    extenedsMapperXmlEntity.setXmlselectsql(extendsUpdataeEntity.getSql());
                    break;
                }
            }
            updatexml.add(extenedsMapperXmlEntity);

        }
        for (ExtendsMapperEntity extendsMapperEntity : servicedeletemethod) {
            ExtenedsMapperXmlEntity extenedsMapperXmlEntity = new ExtenedsMapperXmlEntity();
            for (ExtndsDeleteEntity extndsDeleteEntity : deletesql) {
                if(extndsDeleteEntity.getName().equalsIgnoreCase(extendsMapperEntity.getMethodname())){
                    //是同一个对象
                    extenedsMapperXmlEntity.setReturnType(packagename3+"."+extendsMapperEntity.getReturnType());
                    extenedsMapperXmlEntity.setXmlselectname(extendsMapperEntity.getMethodname());
                    extenedsMapperXmlEntity.setXmlselectsql(extndsDeleteEntity.getSql());
                    break;
                }
            }
            deletexml.add(extenedsMapperXmlEntity);


        }
        for (ExtendsMapperEntity extendsMapperEntity : serviceinsertmethod) {
            ExtenedsMapperXmlEntity extenedsMapperXmlEntity = new ExtenedsMapperXmlEntity();
            for (ExtendsInsertEntity extendsInsertEntity : insertsql) {
                if(extendsInsertEntity.getName().equalsIgnoreCase(extendsMapperEntity.getMethodname())){
                    //是同一个对象
                    extenedsMapperXmlEntity.setReturnType(packagename3+"."+extendsMapperEntity.getReturnType());
                    extenedsMapperXmlEntity.setXmlselectname(extendsMapperEntity.getMethodname());
                    extenedsMapperXmlEntity.setXmlselectsql(extendsInsertEntity.getSql());
                    break;
                }
            }
            insertxml.add(extenedsMapperXmlEntity);
        }
        map.put("selectxml", selectxml);
        map.put("updatexml", updatexml);
        map.put("deletexml", deletexml);
        map.put("insertxml", insertxml);
        //创建文件夹
        File file1 = new File(outpath);
        file1.mkdirs();
        Writer out = new FileWriter(new File(outpath + "/ExtendsMapper.xml"), false);
        temp.process(map, out);
        out.flush();
        out.close();
//if(selectsql==selectsql1){
//    System.out.println(selectsql.hashCode() );
//}else{
//    System.out.println(selectsql.hashCode() );
//    System.out.println(selectsql1.hashCode() );
//}
//
//if(sqlXmlEntity.getSelectsql()==selectsql){
//
//}else if(sqlXmlEntity.getSelectsql()==selectsql1){
//
//}else{
//    System.out.println(selectsql.hashCode() );
//    System.out.println(selectsql1.hashCode() );
//    System.out.println(sqlXmlEntity.getSelectsql());
//}

//开始创建service和serviceimpl层
        //service包地址
        Configuration conf5 = new Configuration();
        //导入模板目录
        File file5 = new File("src/main/resources/");
        conf5.setDirectoryForTemplateLoading(file5);
        Template temp5 = conf5.getTemplate(this.getExtendsserviceftlpath());
        //开始文件输出
        String packagename5 = servicepackage.get(0);
        String[] split5 = packagename5.split("\\.");
        String outpath5 = "src/main/java/" + this.getOutFilePath();
        for (String s : split5) {
            outpath5 += "/" + s;
        }
//        selectsql = sqlXmlEntity.getSelectsql();
//        updatesql = sqlXmlEntity.getUpdatesql();
//        deletesql = sqlXmlEntity.getDeletesql();
//        insertsql = sqlXmlEntity.getInsertsql();
        //添加service所需信息
        //service包位置
        //给xml文件提供mapper地址
        //需要导入的包
        strings.add(packagename4+".ExtendsMapper");
        map.put("serviceimports", strings);
        map.put("serviceimPackage", packagename5);
        //service修改方法传入的参数
//        List<ExtendSelectEntity> selectsql = sqlXmlEntity.getSelectsql();

        map.put("serviceselectmethod", serviceselectmethod);
        map.put("serviceupdatemethod", serviceupdatemethod);
        map.put("servicedeletemethod", servicedeletemethod);
        map.put("serviceinsertmethod", serviceinsertmethod);
        //创建文件夹
        File file15 = new File(outpath5);
        file15.mkdirs();
        Writer out5 = new FileWriter(new File(outpath5 + "/ExtendsService.java"), false);
        temp5.process(map, out5);
        out5.flush();
        out5.close();
       // serviceimpl创建
        Configuration conf6 = new Configuration();
        //导入模板目录
        File file6 = new File("src/main/resources/");
        conf6.setDirectoryForTemplateLoading(file6);
        Template temp6 = conf6.getTemplate(this.getExtendsserviceimplftlpath());
        //开始文件输出n
        String packageame6 = servicepackage.get(0)+".impl";
        String[] split6 = packagename5.split("\\.");
        String outpath6 = "src/main/java/" + this.getOutFilePath();
        for (String s : split6) {
            outpath6 += "/" + s;
        }
        outpath6+="/impl";
//        selectsql = sqlXmlEntity.getSelectsql();
//        updatesql = sqlXmlEntity.getUpdatesql();
//        deletesql = sqlXmlEntity.getDeletesql();
//        insertsql = sqlXmlEntity.getInsertsql();
        //添加service所需信息
        //service包位置
        //给xml文件提供mapper地址
        //需要导入的包
        strings.add(packagename4+".ExtendsMapper");
        map.put("serviceimports", strings);
        map.put("serviceimPackage", packageame6);
        map.put("open_spring_annotate",this.isOpen_spring_annotate());
        //创建文件夹
        File file16 = new File(outpath6);
        file16.mkdirs();
        Writer out6 = new FileWriter(new File(outpath6 + "/ExtendsServiceImpl.java"), false);
        temp6.process(map, out6);
        out6.flush();
        out6.close();

    }




    public String getSqlXmlPath() {
        return SqlXmlPath;
    }

    public void setSqlXmlPath(String sqlXmlPath) {
        SqlXmlPath = sqlXmlPath;
    }

    public String getExtendsmapperftlpath() {
        return extendsmapperftlpath;
    }

    public void setExtendsmapperftlpath(String extendsmapperftlpath) {
        this.extendsmapperftlpath = extendsmapperftlpath;
    }

    public String getExtendsserviceftlpath() {
        return extendsserviceftlpath;
    }

    public void setExtendsserviceftlpath(String extendsserviceftlpath) {
        this.extendsserviceftlpath = extendsserviceftlpath;
    }

    public String getExtendsserviceimplftlpath() {
        return extendsserviceimplftlpath;
    }

    public void setExtendsserviceimplftlpath(String extendsserviceimplftlpath) {
        this.extendsserviceimplftlpath = extendsserviceimplftlpath;
    }


    public List<XmlEntity> getXmlEntities() {
        return xmlEntities;
    }

    public void setXmlEntities(List<XmlEntity> xmlEntities) {
        this.xmlEntities = xmlEntities;
    }

    public String getExtendsentitypath() {
        return extendsentitypath;
    }

    public void setExtendsentitypath(String extendsentitypath) {
        this.extendsentitypath = extendsentitypath;
    }

    public String getExtendsmapperxmlftlpath() {
        return extendsmapperxmlftlpath;
    }

    public void setExtendsmapperxmlftlpath(String extendsmapperxmlftlpath) {
        this.extendsmapperxmlftlpath = extendsmapperxmlftlpath;
    }

    public ArrayList<ExtendsMapperEntity> getmappermethod(List list,boolean isopenresultMap_ref,boolean isopenParam) {
        ArrayList<ExtendsMapperEntity> reslist = new ArrayList<ExtendsMapperEntity>();
        ArrayList<ExtendsSqlModel> slist = (ArrayList<ExtendsSqlModel>) ((ArrayList<ExtendsSqlModel>) list).clone();

        for (ExtendsSqlModel extendsSqlModel : (List<ExtendsSqlModel>)slist) {
            ExtendsMapperEntity extendsMapperEntity = new ExtendsMapperEntity();
            //方法的名称
            extendsMapperEntity.setMethodname(extendsSqlModel.getName());
            //输入参数名称和输入参数的类型
            HashMap<String, String> stringStringHashMap = new HashMap<String, String>();
            //需要导入的包
            if (extendsSqlModel.getParameter_ref() != null&&extendsSqlModel.getParameter_ref().length()>0) {
                //如果存在映射则使用映射
                List<ResultrefEntity> parametes_parameter_type = sqlXmlEntity.getParametes_parameter_type();
                for (ResultrefEntity resultrefEntity : parametes_parameter_type) {
                    if(resultrefEntity.getId().equalsIgnoreCase(extendsSqlModel.getParameter_ref())){
                        for (Property property : resultrefEntity.getProperty()) {
                            //处理字符串
                            String substring = property.getFlag().substring(property.getFlag().indexOf("{") + 1, property.getFlag().lastIndexOf("}"));
                            for (DbColumnType value : values) {
                                if (property.getType().equalsIgnoreCase(value.getType())) {
                                    if (value.getPkg() != null && value.getPkg().length() > 0) {
                                        String pkg = value.getPkg();
                                        String[] split = pkg.split("\\.");
                                        strings.add(pkg);
                                        //自定义添加@Param
                                        if(isopenParam){
                                            stringStringHashMap.put("@Param(\"" + substring + "\")" + split[split.length - 1], substring);
                                            break;

                                        }else{
                                            stringStringHashMap.put( split[split.length - 1], substring);
                                            break;

                                        }
                                    } else {
                                        if(isopenParam){
                                            stringStringHashMap.put("@Param(\"" + substring + "\")" + property.getType(), substring);
                                            break;

                                        }else{
                                            stringStringHashMap.put( property.getType(), substring);
                                            break;

                                        }
                                    }
                                } else {
                                    if(isopenParam){
                                        stringStringHashMap.put("@Param(\"" + substring + "\")" + property.getType(), substring);
                                        break;

                                    }else{
                                        stringStringHashMap.put( property.getType(), substring);
                                        break;

                                    }
                                }
                            }
                        }
                        break;
                    }

                }
            } else {
                //不存在映射则使用表名称对应的类型
                boolean bn = false;
                for (ResultrefEntity resultrefEntity : create_entity_name) {
                    if (resultrefEntity.getJavaname().equalsIgnoreCase(extendsSqlModel.getParameter_tabname_or_basicDataType())) {
                        //获取实体类对象
                        for (XmlEntity xmlEntity : xmlEntities) {
                            if (xmlEntity.getJavaname().equalsIgnoreCase(extendsSqlModel.getParameter_tabname_or_basicDataType())) {
                                Map<String, String> javaname_tabname_map = xmlEntity.getJavaname_tabname_map();
                                for (String s : javaname_tabname_map.keySet()) {
                                    HashMap<String, String> stringStringHashMap1 = xmlEntity.getColumnnameandtypemap().get(s);
                                    for (String s1 : stringStringHashMap1.keySet()) {
                                        strings.addAll(xmlEntity.getImpotrs());
                                        stringStringHashMap.put(s, stringStringHashMap1.get(s1));
                                    }

                                }
                            }

                        }
                        bn = true;
                        break;
                    }

                }

                for (XmlEntity xmlEntity : xmlEntities) {
//                    System.out.println("==================================================");
//                    System.out.println(xmlEntity.getTableEntity().getTabname());
//                    System.out.println(extendSelectEntity.getParameter_tabname_or_basicDataType());
//                    System.out.println(xmlEntity.getTableEntity().getTabname().equalsIgnoreCase((extendSelectEntity.getParameter_tabname_or_basicDataType())));
//                    System.out.println("==================================================");
                    if (xmlEntity.getTableEntity().getTabname().equalsIgnoreCase((extendsSqlModel.getParameter_tabname_or_basicDataType()))) {
                        bn = true;
                        strings.add(packagename3 + "." + xmlEntity.getJavaname());
                        stringStringHashMap.put(xmlEntity.getJavaname(), extendsSqlModel.getParameter_tabname_or_basicDataType());
                        break;
                    }

                }
                //是基本数据类型
                for (DbColumnType value : values) {
                    if (value.getType().equalsIgnoreCase(extendsSqlModel.getParameter_tabname_or_basicDataType())) {
                        strings.add(value.getPkg());
                        stringStringHashMap.put(value.getType(), value.getPkg());
                        break;
                    }
                }

            }
            extendsMapperEntity.setParameter(stringStringHashMap);
            //输出参数类型
            //添加判断是否开启输出类型的添加
            if (isopenresultMap_ref) {
                if (extendsSqlModel.getResultMap_ref() != null && extendsSqlModel.getResultMap_ref().length() > 0) {
                    String resultMap_ref = extendsSqlModel.getResultMap_ref();
                    for (ResultrefEntity resultrefEntity : create_entity_name) {
                        if (resultrefEntity.getId().equalsIgnoreCase(resultMap_ref)) {
                            //设置包名称
//                            extendsSqlModel.setResultMap_tabname_or_basicDataType(packagename3 + "." + resultrefEntity.getJavaname());
                            strings.add(packagename3 + "." + resultrefEntity.getJavaname());
                            //设置返回参数类型
                            extendsMapperEntity.setReturnType(resultrefEntity.getJavaname());
                            break;
                        }
                    }
                } else {
                    boolean b = false;
                    //没有启动自定义
                    for (XmlEntity xmlEntity : xmlEntities) {
                        if (xmlEntity.getJavaname().equalsIgnoreCase(extendsSqlModel.getResultMap_tabname_or_basicDataType())) {
//                            extendsSqlModel.setResultMap_tabname_or_basicDataType(xmlEntity.getEntitypackagename() + "." + xmlEntity.getJavaname());
                            //是表对象
                            //设置返回值类型
                            extendsMapperEntity.setReturnType(xmlEntity.getJavaname());
                            b=true;
                            break;
                        }

                    }
                    if (b) {

                    }else{
                        //如果都没有则是基本书里类型
                        for (DbColumnType value : values) {
                            if (value.getType().equalsIgnoreCase(extendsSqlModel.getResultMap_tabname_or_basicDataType())) {
//                                extendsSqlModel.setResultMap_tabname_or_basicDataType(value.getPkg());
                                strings.add(value.getPkg());
                                extendsMapperEntity.setReturnType(value.getType());
                                break;
                            }
                        }
                    }


                }
            }

            reslist.add(extendsMapperEntity);


//            extendsMapperEntities.add(extendsMapperEntity);

        }

        return reslist;

    }

}
